﻿using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class SteerFlee : SteerBase
{
    /// <summary>
    /// 逃跑对象
    /// </summary>
    public Vector3 TagPoint;
    public float fleeDis;


    public override string CName
    {
        get
        {
            return SteerName.StN_SteerFlee;
        }
    }

    public override Vector3 CalculateForce()
    {
        Vector3 force = Vector3.zero;
        Vector3 toTag = m_pVehicle.Postion - TagPoint;
        if(toTag.sqrMagnitude <= fleeDis)
        {
            force = toTag.normalized * m_pVehicle.m_fMaxSpeed - m_pVehicle.m_v3Velocity;
        }
        return force;
    }

    private void Update()
    {
        
    }
}
